import request from '@/router/axios';

export const getList = (pagePath) => {
    return request({
        url: '/api/mes-admin/pageattribute/list',
        method: 'get',
        params: {
            pagePath
        }
    });
};

export const getDetail = (pagePath) => {
    return request({
        url: '/api/mes-admin/pageattribute/detail',
        method: 'get',
        params: {
            pagePath
        }
    });
};

export const remove = (ids) => {
    return request({
        url: '/api/mes-admin/pageattribute/remove',
        method: 'post',
        params: {
            ids
        }
    });
};

export const add = (row) => {
    return request({
        url: '/api/mes-admin/pageattribute/submit',
        method: 'post',
        data: row
    });
};

export const update = (row) => {
    return request({
        url: '/api/mes-admin/pageattribute/submit',
        method: 'post',
        data: row
    });
};

export const getPagePathList = (code) => {
    return request({
        url: '/api/blade-system/dict/dictionary',
        method: 'get',
        params: {
            code
        }
    });
};

export const getAttributeConfig = (current, size, params) => {
    return request({
        url: '/api/mes-admin/customerattribute/page',
        method: 'get',
        params: {
            ...params,
            current,
            size
        }
    });
};

export const getAttributeConfigById = (id) => {
    return request({
        url: '/api/mes-admin/customerattribute/detail',
        method: 'get',
        params: {
            id
        }
    });
};

export const addAttributeConfig = (row) => {
    return request({
        url: '/api/mes-admin/customerattribute/submit',
        method: 'post',
        data: row
    });
};

export const removeAttributeConfig = (ids) => {
    return request({
        url: '/api/mes-admin/customerattribute/remove',
        method: 'post',
        params: {
            ids
        }
    });
};
